<template>
  <div class>
    <el-card class="ep-card ep-search" id="card">
      <el-row :gutter="0">
        <el-col :span="3" style="float:right">
          <el-button type="primary" size="mini"  @click="back">返回</el-button>
        </el-col>
        <el-col :span="2" style="float:right">
          <el-button type="success" size="mini"  @click="submit">保存</el-button>
        </el-col>
      </el-row>
    </el-card>
    <el-tabs type="border-card">
      <el-tab-pane label="基本信息">
        <entBaseComponent ref="entBaseComponent"></entBaseComponent>
        <el-divider content-position="left">工商注册信息</el-divider>
          <entBaseGsComponent ref="entBaseGsComponent">
          </entBaseGsComponent>
          
      </el-tab-pane>
      <el-tab-pane label="人员信息" name="1">
        <entpersonComponent ref="entpersonComponent"></entpersonComponent>
      </el-tab-pane>
      <el-tab-pane label="股权信息">
        <entEquityComponent ref="entEquityComponent"></entEquityComponent>
      </el-tab-pane>
      <el-tab-pane label="往来银行">
        <entbankComponent ref="entbankComponent"></entbankComponent>
      </el-tab-pane>
      <el-tab-pane label="关联信息" name="4">
        <entcorrelationComponent ref="entcorrelationComponent"></entcorrelationComponent>
      </el-tab-pane>
      <el-tab-pane label="企业资质">
        <entqualificationComponent ref="entqualificationComponent"></entqualificationComponent>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>

<script>
export default {
  components: {
    entBaseComponent: require("./ent-base.vue").default,
    entBaseGsComponent: require("./ent-base-gs.vue").default,
    entbankComponent: require("./ent-bank.vue").default,
    entcorrelationComponent: require("./ent-correlation.vue").default,
    entqualificationComponent: require("./ent-qualification.vue").default,
    entEquityComponent: require("./ent-equity.vue").default,
    entpersonComponent: require("./ent-person.vue").default
  },
  data() {
    return {
      status:"0"
    };
  },
  computed: {},
  mounted() {},
  methods: {
    back(){
      this.$router.push({path:"/ent/entBaseList"});
    },
    submit() {
      //合作银行列表
      let entBankList = this.$refs.entbankComponent.getdata();
      //企业人员列表
      let entPersonList=this.$refs.entpersonComponent.getEntPersonData();
      //其他人员列表
      let entOtherList=this.$refs.entpersonComponent.getEntOtherData();
      //关联企业列表
      let glqyList=this.$refs.entcorrelationComponent.getglqy();
      //上下游企业列表
      let sxyqyList=this.$refs.entcorrelationComponent.getsxyqy();
      //竞争对手列表
      let jzdsList=this.$refs.entcorrelationComponent.getjzds();
      //企业资质列表
      let qyzzList=this.$refs.entqualificationComponent.getdata();
      // //股权信息列表
      let entEquityList=this.$refs.entEquityComponent.getdata();
      let entBaseData = this.$refs.entBaseComponent.getdata();
      let entBaseGsData = this.$refs.entBaseGsComponent.getdata();
      let entBase={...entBaseData,...entBaseGsData};

      let params={
        entBankList:entBankList,
        entPersonList:entPersonList,
        entOtherList:entOtherList,
        glqyList:glqyList,
        sxyqyList:sxyqyList,
        jzdsList:jzdsList,
        qyzzList:qyzzList,
        entEquityList:entEquityList,
        entBase:entBase,
      }

      this.$api.post( '/api/biz/ent/doSubmit',params).then(res => {
              if(res.retHead.code=="0000000"){
                    this.$message({
                        type: 'success',
                        message: "保存成功"
                    });
                }else{
                    this.$message({
                        type: 'error',
                        message: res.retHead.message
                    });
                }
            });
    }
  },
  created() {}
};
</script>
<style lang='scss' scoped>
</style>